package com.game;

import android.graphics.Canvas;

import com.javenwong.android.engine.GameCanvas;
import com.javenwong.android.engine.biology.Animation;

 

public class HitEffect {

	private int x;
	private int y;
	private Animation blast;

	/**
	 * @param x
	 *            X坐标
	 * @param y
	 *            Y坐标
	 * @param type
	 *            0被打亮光 1爆炸
	 */
	public HitEffect(int x, int y) {
		this.x = x;
		this.y = y;
		blast = Animation.getAnimation("blast_28"); 
	}

	public void draw(Canvas g, int cameraX, int cameraY) {
		if (blast != null) { 
			blast.drawFrame(x - cameraX, y - cameraY, g);
		}
	}

	/**
	 * 下一帧
	 * 
	 * @return
	 */
	public boolean nextFrame() {
		return blast.loopFrame(GameCanvas.timeCha);
	}
}
